<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 */
class User extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'users';

    protected $guarded = [];

    protected $appends = ['sex_zh'];

    public function getSexZhAttribute($key)
    {
        switch ($this->attributes['sex']){
            case 0:
                return '未知';
            case 1:
                return '男';
            case 2:
                return '女';
        }
    }

}